<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //**4. 请把下列的数组变成是: [['苹果','胡萝卜', '花生'], ['梨', '西芹', '坚果']....]**
        var basket = [{
            fruit: "苹果",
            veg: "胡萝卜",
            nut: "花生"
        }, {
            fruit: "梨",
            veg: "西芹",
            nut: "坚果"
        }, {
            fruit: "香蕉",
            veg: "土豆",
            nut: "杏仁"
        }, {
            fruit: "西瓜",
            veg: "豆芽",
            nut: "核桃"
        }]

        let arr = []
        basket.forEach(item => {
            // values可拿到全部值数组， keys可拿到全部keys数组
            arr.push(Object.values(item))
        });

        console.log(arr)
    </script>
</body>

</html>